import React from 'react';

export interface IRoute {
  component: any;
  path: string;
  name?: string;
}
export interface IrouteParams {
  title?: string;
}
export function getHomeButtonlist() {
  const list: IRoute[] = [];
  routes.map((item, index) => {
    if (index > 2) {
      list.push(item);
    }
    return item;
  });
  return list;
}
const routes: IRoute[] = [
  // tab页面路由注册
  {
    path: '/',
    component: React.lazy(() => import('../views/home')),
  },
  {
    path: '/list',
    component: React.lazy(() => import('../views/list')),
  },
  {
    path: '/mine',
    component: React.lazy(() => import('../views/mine')),
  },

  // 首页 页面路由注册
  {
    path: '/hooks/:title',
    component: React.lazy(() => import('../views/hooks-demo')),
    name: 'hooks-demo',
  },
  {
    path: '/ts/:title',
    component: React.lazy(() => import('../views/ts')),
    name: 'ts-demo',
  },
  {
    path: '/es6/:title',
    component: React.lazy(() => import('../views/es6')),
    name: 'es6-demo',
  },
  {
    path: '/mobx/:title',
    component: React.lazy(() => import('../views/mobx')),
    name: 'mobx-demo',
  },
  {
    path: '/rtl/:title',
    component: React.lazy(() => import('../views/rtl')),
    name: 'rtl-demo',
  },
  {
    path: '/language/:title',
    component: React.lazy(() => import('../views/language')),
    name: 'language-demo',
  },
  {
    path: '/daletou/:title',
    component: React.lazy(() => import('../views/daletou')),
    name: 'daletou',
  },
  {
    path: '/markdown/:title',
    component: React.lazy(() => import('../views/markdown-demo')),
    name: 'markdown-demo',
  },
];
export default routes;
